Skip to content

refactor(db): remove deployment compatibility paths#361

Merged
KurodaKayn merged 7 commits into
mainfrom
refactor/remove-db-compatibility
Jun 21, 2026
Merged

refactor(db): remove deployment compatibility paths#361
KurodaKayn merged 7 commits into
mainfrom
refactor/remove-db-compatibility

Conversation

@KurodaKayn

Copy link
Copy Markdown
Owner

Change Description

  • Removes production migration planning from the database optimization plan now that the project has not deployed with real customer data.
  • Simplifies database startup to initialize the current target schema instead of carrying old-data compatibility repair paths.
  • Removes legacy publication status aliases and switches backend services/tests to canonical status names.

Implementation Approach

  • Reframed the database roadmap around pre-deployment schema initialization and future validation-only Citus planning.
  • Replaced the startup migration wrapper with syncSchema, keeping AutoMigrate and required indexes while deleting legacy backfills and column rewrites.
  • Updated publishing/prepublish/dashboard/readmodel/stats call sites from old aliases to draft, succeeded, and cancelled constants.

Testing

  • cd backend && go test ./... passed.
  • Lefthook pre-commit backend format/lint passed for the backend commits.

The database optimization plan still described production migration choreography that does not match an undeployed project.

Replace those sections with pre-deployment schema guidance and validation-focused Citus planning.

The plan now points toward clean target schema changes before real customer data exists.
Startup schema setup carried old-data repair logic even though the project has not been deployed with customer data.

Replace the migration wrapper with a direct schema sync path and remove legacy backfill and column rewrite tests.

Database startup now initializes the current target schema without carrying historical compatibility code.
Publication status aliases kept old naming alive after the API contract moved to draft, succeeded, and cancelled values.

Remove the alias constants and switch services plus tests to the canonical publication status names.

Publishing code now uses one status vocabulary without compatibility indirection.
Multiple API and worker processes can call schema initialization during the same rollout.

Wrap the clean schema sync path in a Postgres transaction advisory lock without restoring legacy data repair logic.

Fresh database startup now avoids concurrent AutoMigrate and index creation races.
The non-production Redis Cluster keeps TLS client authentication enabled for app-facing traffic.

Teach backend, browser-worker, and collab-service Redis clients to load client certificate and key files, then expose the paths in Kubernetes config and docs.

Cluster cutover can keep server-side mTLS without breaking app Redis clients.
The non-production Redis Cluster backup wrote topology files while dataset files stayed on pod PVCs.

Keep the snapshot trigger, then export RDB files from primary nodes into the backup PVC and update the drill notes.

Restore drills now have Redis data artifacts alongside Cluster topology metadata.
@KurodaKayn KurodaKayn force-pushed the refactor/remove-db-compatibility branch from 619f72a to 3c97694 Compare June 21, 2026 11:49
@KurodaKayn KurodaKayn merged commit 47cb7d6 into main Jun 21, 2026
17 checks passed
@KurodaKayn KurodaKayn deleted the refactor/remove-db-compatibility branch June 21, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant